package com.xinzhi.savingpot.rminfo.service.impl;

import com.xinzhi.savingpot.rminfo.pojo.IAutonymVo;
import com.xinzhi.savingpot.rminfo.service.IAutonymService;
import com.xinzhi.savingpot.util.BaseResponse;
import com.xinzhi.savingpot.util.IdentificationUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class AutonymImpl implements IAutonymService {
    
    @Override
    public BaseResponse Autonym(IAutonymVo AV) {
        if (AV!=null){
            Map<String, Object> stringObjectMap = IdentificationUtil.verifyIdentityCard(AV.getName(), AV.getIdentityCard());
            stringObjectMap.get("name");
            stringObjectMap.get("idNo");
            stringObjectMap.get("respMessage");
            stringObjectMap.get("respCode");
            stringObjectMap.get("province");
            stringObjectMap.get("city");
            stringObjectMap.get("county");
            stringObjectMap.get("birthday");
            stringObjectMap.get("sex");
            stringObjectMap.get("age");

            return new BaseResponse(200,"身份审核中，请等待",1);
        }
        Map<String, Object> stringObjectMap = IdentificationUtil.identityCard(AV.getUrls(), AV.getPAndN());


        return new BaseResponse(400,"身份证号不存在,请重新输入",0);
    }
}
